THREE = {};
importScripts('../lib/threejs/ColladaLoader.js');
var callback;
self.addEventListener('message', function(e) 
{
	var data = e.data;
	var modelLoader = data.model;
	
	var loader = new THREE.ColladaLoader();
	loader.options.convertUpAxis = true;
	
	loader.load( "./../../"+data.params.model, callback );
}, false);

self.callback = function colladaReady( collada )
{
	if(	params.scale != undefined)
	{
		collada.scene.scale.x = params.scale;
		collada.scene.scale.y = params.scale;
		collada.scene.scale.z = params.scale;
		collada.scene.updateMatrix();
	}
	reply("loadComplete", {scene:collada.scene,name:params.name} );  
	throw JSON.stringify({data:"bouboup"})
}